package com.niit.onlinemusicserver.controller;

import com.niit.onlinemusicserver.common.R;
import com.niit.onlinemusicserver.model.request.AdminRequest;
import com.niit.onlinemusicserver.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

@RestController
public class AdminController {
  @Autowired
  private AdminService adminService;

  // 判断是否登录成功
  @PostMapping("/admin/login/status")
  public R loginStatus(@RequestBody AdminRequest adminRequest, HttpSession session) {
    R result = adminService.verityPasswd(adminRequest, session);
    return result;
  }
}